All Functions Used So Far, Week 9

read_excel

{readxl}

Read an Excel file

as.numeric

{base}

Coerce a vector to numeric

recode

{dplyr}

Recode a variable

prop.test

{stats}

Test of Equal or Given Proportions

c

{base}

Combine values/vectors into a vector

aes

{GGPLOT2}

Construct aesthetic mapping of a ggplot graph

ifelse

{base}

Return a or b depending on the value of test

summary

{base}

Obtain summary statistics or detailed regression output

read_dta

{haven}

Read a .dta file (Stata data)

chisq.test

{stats}

Chi-Squared test (e.g. for cross-tabulations)

rm

{base}

Remove objects

lm

{base}

Fit a linear model

xlab

{GGPLOT2}

Label the x axis (ggplot)

leveneTest

{car}

Computes Levene’s test for homogeneity of variance across groups.

droplevels

{base}

Drop Unused Levels from Factors

attach

{base}

Attach Set of R Objects to Search Path

levels

{base}

Get levels of a factor

confint

{stats}

Calculate confidence Intervals for Model Parameters

ggplot

{GGPLOT2}

Create a ggplot graph

library

{base}

Load an R package

names

{base}

Retrieve names of a list/vector

log

{base}

log (default base = e)

setwd

{base}

Set Working Directory

stargazer

{stargazer}

Create a regression output table

as.character

{base}

Coerce a vector to character

is.element

{base}

Check if a value is element of a vector

table

{base}

Obtain frequency table of a variable/cross-tabulation of two variables

prop.table

{base}

Transform frequency table into table of proportions

geom_point

{GGPLOT2}

Generates a scatter plot

ordered

{dplyr}

Create an ordered factor

with

{base}

evaluate expression in the context of a data frame

ls

{base}

Return a vector of character strings giving the names of the objects in the specified environment

theme_classic

{GGPLOT2}

A minimalistic theme with no gridlines

cut

{base}

Convert Numeric to Factor

geom_smooth

{GGPLOT2}

Generates a smoothed conditional means curve / line

subset

{base}

Return subsets of vectors, matrices or data frames which meet conditions.

relevel

{stats}

Reorder Levels of Factor

scale_y_continuous

{GGPLOT2}

Customise continuous y axis

scale_x_continuous

{GGPLOT2}

Customise continuous x axis

read.csv

{utils}

Read a csv file to data frame. Specify stringsAsFactors = FALSE to keep all string columns as characters

t.test

{stats}

Performs one and two sample t-tests on vectors of data.

ylab

{GGPLOT2}

Label the y axis (ggplot)

mutate

{dplyr}

Modify/create a column in a data frame

The end!